package com.liyueheng.mapper;

import com.liyueheng.pojo.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserMapper {
    // 根据用户名查询用户
    @Select("SELECT * FROM admin_user WHERE username = #{username}")
    User findByUsername(String username);
    // 添加用户
    @Insert("insert into admin_user(username,password,create_time,update_time)" +
            " values(#{username},#{password},now(),now())")
    void add(String username, String password);
}
